Method and system for detecting interrupts from detachable electronic accessories or peripherals

ABSTRACT

Aspects of a method and system for detecting interrupts from detachable electronic accessories or peripherals are provided. In this regard, a hardware audio CODEC may be operable to compare a voltage on one or more biased pins of an accessory or peripheral port to one or more reference voltages and filter one or more output signals generated from the comparison. When an accessory or peripheral is coupled to the accessory or peripheral port, interrupts from the accessory or peripheral may be detected based on results of the comparison and/or the filtering. An interrupt may be detected when the voltage on the one or more pins may be below the one or more reference voltages. An interrupt may be detected when the voltage on the one or more pins may be below the one or more reference voltages for a plurality of consecutive clock cycles.

CROSS-REFERENCE TO RELATED APPLICATIONS/INCORPORATION BY REFERENCE

This patent application makes reference to U.S. patent application Ser. No. 12/268,304, which was filed on Nov. 10, 2008.

The above stated application is hereby incorporated herein by reference in its entirety.

FIELD OF THE INVENTION

Certain embodiments of the invention relate to electronic devices. More specifically, certain embodiments of the invention relate to a method and system for detecting interrupts from detachable electronic accessories or peripherals.

BACKGROUND OF THE INVENTION

As electronic devices are increasingly relied upon to perform a growing number of functions in an increasing number of situations, improving the versatility of electronic devices has become a focus of many electronics manufacturers. One way in which the versatility and utility of electronic devices may be improved is through the use of peripheral accessories or peripherals. These accessories or peripherals may be attached and detached from the electronic devices as needed in order to customize the functions and/or use of the device. For example, smart phones may support the use of accessories or peripherals such as headsets, microphones, keyboards, and storage devices. However, although it may be desirable to support a multitude of accessories or peripherals, the number and/or types of connectors and/or ports of an electronic device may be limited by space, connectivity, and/or cost considerations.

Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of skill in the art, through comparison of such systems with some aspects of the present invention as set forth in the remainder of the present application with reference to the drawings.

BRIEF SUMMARY OF THE INVENTION

A system and/or method is provided detecting interrupts from detachable electronic accessories or peripherals, substantially as shown in and/or described in connection with at least one of the figures, as set forth more completely in the claims.

These and other advantages, aspects and novel features of the present invention, as well as details of an illustrated embodiment thereof, will be more fully understood from the following description and drawings.

BRIEF DESCRIPTION OF SEVERAL VIEWS OF THE DRAWINGS

FIG. 1A is a diagram illustrating an exemplary system comprising a hardware audio CODEC enabled to detect interrupt signals from attached accessories or peripherals, in accordance with an embodiment of the invention.

FIG. 1B is a diagram illustrating detection of interrupts from an attached accessory or peripheral, in accordance with an embodiment of the invention.

FIG. 2 is a diagram illustrating an exemplary electronic device enabled to interface with a variety of accessories or peripherals via an accessory or peripheral port, in accordance with an embodiment of the invention.

FIG. 3 is a diagram illustrating a subsystem for detection of interrupts from an attached accessory or peripheral, in accordance with an embodiment of the invention.

FIG. 4 is a diagram illustrating an exemplary filter for de-bouncing interrupt signals, in accordance with an embodiment of the invention.

FIG. 5 is a diagram illustrating an exemplary filter for de-bouncing interrupt signals, in accordance with an embodiment of the invention.

FIG. 6 is a flow chart illustrating exemplary steps for detecting and handling interrupts from an attached accessory or peripheral, in accordance with an embodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

Certain embodiments of the invention may be found in a method and system for detecting interrupts from detachable electronic accessories or peripherals. In various embodiments of the invention, a hardware audio CODEC may be operable to compare a voltage on one or more biased pins of an accessory or peripheral port to one or more reference voltages. The hardware audio CODEC may filter one or more of the output signals generated from the comparison. In instances when an accessory or peripheral is coupled to the accessory or peripheral port, one or more interrupts from the accessory or peripheral may be detected based on results of the comparison and/or the filtering. The hardware audio CODEC may bias the one or more pins by applying a voltage to each of the one or more pins via one or more resistances. The output signals generated from the comparison may be filtered by the hardware audio CODEC based on a class, type, manufacturer identifier, and/or model identifier of an accessory or peripheral attached to the accessory or peripheral port. A state and/or behavior of the output signals generated from the comparison may be interpreted based on a class, a type, a manufacturer identifier, and/or a model identifier of an accessory or peripheral attached to the accessory or peripheral port. A state and or behavior of the filtered one or more signals may be interpreted based on a class, a type, a manufacturer identifier, and/or a model identifier of an accessory or peripheral attached to the accessory or peripheral port. The one or more signals generated from the comparison may be filtered by one or more filters in the hardware audio CODEC which may be configured into integrate-and-dump or decimate-by-M modes of operation. An interrupt may be detected when the voltage on the one or more pins may be below the one or more reference voltages. An interrupt may be detected when the voltage on the one or more pins may be below the one or more reference voltages for a plurality of consecutive clock cycles.

FIG. 1A is a diagram illustrating an exemplary system comprising a hardware audio CODEC enabled to detect interrupt signals from attached accessories or peripherals, in accordance with an embodiment of the invention. Referring to FIG. 1A, the wireless system 150 may comprise an antenna 157, a transmitter 152, a receiver 153, a digital signal processor 154, a processor 156, a memory 158, a Bluetooth (BT) and/or universal serial bus (USB) subsystem 162, an hardware audio CODEC 164, an accessory or peripheral port 166, an analog microphone 168, speaker(s) 170, a Bluetooth headset 172, a hearing aid compatibility (HAC) coil 174, a dual digital microphone 176, and a vibration transducer 178. The antenna 157 may be used for reception and/or transmission of RF signals. Different wireless systems may use different antennas for transmission and reception.

The transmitter 152 may comprise suitable logic, circuitry, and/or code that may be operable to modulate and up-convert baseband signals to RF signals for transmission by one or more antennas, which may be represented generically by the antenna 157. The transmitter 152 may be operable to execute other functions, for example, filtering the baseband and/or RF signals, and/or amplifying the baseband and/or RF signals. Although a single transmitter 152 is shown, the invention is not so limited. Accordingly, there may be a plurality of transmitters and/or receivers. In this regard, the plurality of transmitters may enable the wireless system 150 to handle a plurality of wireless protocols and/or standards including cellular, wireless local area networking (WLAN), and personal area networking (PAN). In addition, the transmitter 152 may be combined with the receiver 153 and implemented as a combined transmitter and receiver (transceiver).

The receiver 153 may comprise suitable logic, circuitry, and/or code that may be operable to down-convert and demodulate received RF signals to baseband signals. The RF signals may be received by one or more antennas, which may be represented generically by the antenna 157. The receiver 153 may be operable to execute other functions, for example, filtering the baseband and/or RF signals, and/or amplifying the baseband and/or RF signals. Although a single receiver 153 is shown, the invention is not so limited. Accordingly, there may be a plurality of receivers. In this regard, the plurality of receivers may enable the wireless system 150 to handle a plurality of wireless protocols and/or standards including cellular, WLAN, and PAN. In addition, the receiver 153 may be implemented as a separate transmitter and a separate receiver.

The DSP 154 may comprise suitable logic, circuitry, and/or code that may be operable to process audio signals. In various embodiments of the invention, the DSP 154 may encode, decode, modulate, demodulate, encrypt, and/or decrypt audio signals. In this regard, the DSP 154 may be operable to perform computationally intensive processing of audio signals.

The processor 156 may comprise suitable logic, circuitry, and/or code that may be operable to configure and/or control one or more portions of the system 150, control data transfers between portions of the system 150, and/or otherwise process data. Control and/or data information may be transferred between the processor 156 and one or more of the transmitter 152, the receiver 153, the DSP 154, the memory 158, the hardware audio CODEC 164, and the BT and/or USB subsystem 162. The processor 156 may be utilized to update and/or modify programmable parameters and/or values in one or more of the transmitter 152, the receiver 153, the DSP 154, the memory 158, the hardware audio CODEC 164, and the BT and/or USB subsystem 162. In this regard, a portion of the programmable parameters may be stored in the system memory 158. In an exemplary embodiment of the invention, the processor 156 may be operable to detect interrupts from an accessory or peripheral attached to the accessory or peripheral port 166 based on one or more signals from one or more interrupt detection modules within the system 150. The processor 156 may be any suitable processor or controller. For example, the processor 156 may be a reduced instruction set computing (RISC) microprocessor such as an advanced RISC machine (ARM), advanced virtual RISC (AVR), microprocessor without interlocked pipeline stages (MIPS), or programmable intelligent controller (PIC).

The system memory 158 may comprise suitable logic, circuitry, and/or code that may be operable to store a plurality of control and/or data information, including parameters needed to configure one or more of the transmitter 152, the receiver 153, the DSP 154, and/or the hardware audio CODEC 164. The system memory 158 may store at least a portion of the programmable parameters that may be manipulated by the processor 156. In an exemplary embodiment of the invention, the memory 158 may store information utilized to detect interrupts from an accessory or peripheral attached to the accessory or peripheral port 166.

In an exemplary embodiment of the invention, the DSP 154 and processor 156 may exchange audio data and control information via the memory 158. For example, the processor 156 may write encoded audio data, such as MP3 or AAC audio, to the memory 158 and the memory may pass the encoded audio data to the DSP 154. Accordingly, the DSP 154 may decode the data and write pulse-code modulated (PCM) audio back into the shared memory for the processor 156 to access and/or to be delivered to the hardware audio CODEC 164.

The BT and/or USB subsystem 162 may comprise suitable circuitry, logic, and/or code that may be operable to transmit and receive Bluetooth and/or Universal Serial Bus (USB) signals. The BT and/or USB subsystem 162 may be operable to up-convert, down-convert, modulate, demodulate, and/or otherwise process BT and/or USB signals. In this regard, the BT and/or USB subsystem 162 may handle reception and/or transmission of BT and/or USB signals via a wireless communication medium and/or handle reception and/or transmission of USB signals via a wireline communication medium. Information and/or data received via a BT and/or USB connection may be communicated between the BT and/or USB subsystem 162 and one or more of the transmitter 152, the receiver 153, the DSP 154, the processor 156, the memory 158, and the hardware audio CODEC 164. For example, the BT and/or USB subsystem 162 may extract audio from a received BT and/or USB signal and may convey the audio to other portions of the wireless system 150 via an inter-IC sound (I²S) bus. Information and/or data may be communicated from one or more of the transmitter 152, the receiver 153, the DSP 154, the processor 156, the memory 158, and the hardware audio CODEC 164 to the BT and/or USB subsystem 162 for transmission over a BT and/or USB connection. For example, audio signals may be received from other portions of the wireless system 150 via an I²S bus and the audio signal may be transmitted via a BT and/or USB connection. Additionally, control and/or feedback information may be communicated between the BT and/or USB subsystem 162 and one or more of the transmitter 152, the receiver 153, the DSP 154, the processor 156, the memory 158, and the hardware audio CODEC 164.

The hardware audio CODEC 164 may comprise suitable circuitry, logic, and/or code that may be operable to process audio signals received from and/or communicated to input and/or output devices. The input devices may be within or communicatively coupled to the wireless device 150, and may comprise, for example, the analog microphone 168, the stereo speakers 170, the Bluetooth headset 172, the hearing aid compatible (HAC) coil 174, the dual digital microphone 176, the vibration transducer 178 and/or one or more accessories or peripherals attached via the accessory or peripheral port 166. The hardware audio CODEC 164 may up-sample and/or down-sample audio signals to one or more desired sample rates for communication to an audio output device, the DSP 154, and/or the BT and/or USB subsystem 162. In this regard, the hardware audio CODEC 164 may comprise one or more decimation filters and/or sample rate converters which may be operable to down-convert a sampling frequency of one or more audio signals. Additionally, the decimation filters may be operable to adjust a gain of the down-sampled signals. The hardware audio CODEC 164 may also be enabled to handle a plurality of data sampling rate inputs. For example, the hardware audio CODEC 164 may accept digital audio signals at sampling rates such as 8 kHz, 11.025 kHz, 12 kHz, 16 kHz, 22.05 kHz, 24 kHz, 32 kHz, 44.1 kHz, and/or 48 kHz. The hardware audio CODEC 164 may be enabled to handle a plurality of digital audio inputs of various resolutions, such as 16 or 18-bit resolution, for example. The hardware audio CODEC 164 may support mixing of a plurality of audio sources. For example, the hardware audio CODEC 164 may support audio sources such as general audio, polyphonic ringer, I²S FM audio, vibration driving signals, and voice. In an exemplary embodiment of the invention, the general audio and polyphonic ringer sources may support the plurality of sampling rates that the hardware audio CODEC 164 may be enabled to accept, while the voice source may support a portion of the plurality of sampling rates, such as 8 kHz and 16 kHz. In an exemplary embodiment of the invention, the hardware audio CODEC 164 may comprise suitable logic, circuitry, and/or code operable to detect interrupt signals from an accessory or peripheral attached to the accessory or peripheral port 166. In this regard, the hardware audio CODEC 164 may comprise the analog HW 206 and the digital HW 208 as described with respect to FIG. 2.

The hardware audio CODEC 164 may utilize a programmable infinite impulse response (IIR) filter and/or a programmable finite impulse response (FIR) filter for at least a portion of the audio sources to compensate for passband amplitude and phase fluctuation for different input and/or output devices. In this regard, filter coefficients may be configured or programmed dynamically based on operations. Moreover, filter coefficients may all be switched in one-shot or may be switched sequentially, for example. The hardware audio CODEC 164 may also utilize a modulator, such as a Delta-Sigma (ΔΣ) modulator, for example, to code digital output signals for analog processing. The hardware audio CODEC 164 may be referred to, for example, as an audio coding and/or decoding device or CODEC. In various embodiments of the invention, the hardware audio CODEC 164 may be implemented in dedicated hardware.

The accessory or peripheral port 166 may comprise a physical connection for a variety of accessories or peripherals to be communicatively coupled to the wireless system 150. Exemplary accessories or peripherals which may be attached via the accessory or peripheral port 166 may comprise headsets, microphones, keyboards, and storage devices.

The analog microphone 168 may comprise suitable circuitry, logic, and/or code that may detect sound waves and convert them to electrical signals via a piezoelectric effect, for example. The electrical signals generated by the analog microphone 168 may comprise analog signals that may require analog to digital conversion before processing.

The speaker(s) 170 may comprise one or more speakers that may be operable to generate acoustic waves from electrical signals received from the hardware audio CODEC 164. In an exemplary embodiment of the invention, there may be a pair of speakers which may be operable to output acoustic waves corresponding to, for example, left and right stereo channels.

The Bluetooth headset 172 may comprise a wireless headset that may be communicatively coupled to the wireless system 150 via the BT and/or USB subsystem 162. In this manner, the wireless system 150 may be operated in a hands-free mode, for example.

The HAC coil 174 may comprise suitable circuitry, logic, and/or code that may enable communication between the wireless device 150 and a hearing aid, for example. In this regard, audio signals may be magnetically coupled from the HAC coil 174 to a coil in a user's hearing aid.

The dual digital microphone 176 may comprise suitable circuitry, logic, and/or code that may detect sound waves and convert them to electrical signals. The electrical signals generated by the dual digital microphone 176 may comprise digital signals, and thus may not require analog to digital conversion prior to digital processing in the hardware audio CODEC 164.

The vibration transducer 178 may comprise suitable circuitry, logic, and/or code that may be operable to notify a user of an incoming call, alerts and/or message to the wireless device 150 without the use of sound. The vibration transducer may generate vibrations that may be in synch with, for example, audio signals such as speech or music.

In operation, attachment of an accessory or peripheral to the accessory or peripheral port 166 may be detected via one or more signals conveyed to the hardware audio CODEC 164 from, for example, a mechanical switch. Subsequently, a bias may be applied to one or more pins of the accessory or peripheral port 166 and a resulting voltage on the one or more pins may be compared to a reference voltage via one or more comparators within the hardware audio CODEC 164. The comparator output(s) may be de-bounced via one or more filters within the hardware audio CODEC 164. The comparator output(s) and/or the de-bounced versions of the comparator output(s) may then be monitored to detect interrupts.

FIG. 1B is a diagram illustrating detection of interrupts from an attached accessory or peripheral, in accordance with an embodiment of the invention. Referring to FIG. 1B, there is shown a bias voltage generator 102, an accessory or peripheral port 104, accessory or peripheral identification modules 106 ₁, . . . , 106 _(N), and switch 112.

The accessory or peripheral port 104 may comprise a connector which may enable attaching to one or more accessories or peripherals. Exemplary accessories or peripherals 110 which may be attached via the port 104 may comprise headsets, microphones, keyboards, and storage devices. The accessory or peripheral port 104 may comprise one or more pins which may convey electrical signals to and/or from an attached accessory or peripheral. The accessory or peripheral port 104 may be also be referred by a variety of names such as connector, receptacle, and plug.

The conductor(s) 105 ₁, . . . , 105 _(N) may couple the accessory or peripheral port 104 to the accessory or peripheral identification modules 160 ₁, . . . , 106 _(N). In this regard, each of the conductors may be electrically coupled to a pin of the accessory or peripheral port 104. Accordingly, power, control signals, and/or data may be conveyed to and/or from an attached accessory or peripheral via the conductors 105 ₁, . . . , 105 _(N).

The switch 112 may be utilized to detect when an accessory or peripheral has been attached to the accessory or peripheral port 104. In this regard, the switch 112 may be a mechanical switch which may couple the conductor 111 to GND, as indicated by the dashed line, while an accessory or peripheral may be attached to the accessory or peripheral port 104.

The bias generator 102 may comprise suitable logic, circuitry, and/or code that may be operable to apply a DC bias to conductors 105 ₁, . . . , 105 _(N) based on one or more control signals 109 ₁, . . . , 109 _(N). In an exemplary embodiment of the invention, the bias generator 102 may be operable to generate three bias points 0V, V_(low), and V_(hi). Accordingly, 0V, V_(low), or V_(hi) may be applied to each of the conductors 105 ₁, . . . , 105 _(N). In various embodiments of the invention, generated bias voltage(s) may be current limited and/or may be applied via a known resistance. In an exemplary embodiment of the invention, V_(low) may be approximately 0.4V and V_(hi) may be approximately 2.1V and the bias may be applied via a 2.2 k ohm resistance. One or more of the conductors 105 ₁, . . . , 105 _(N) may be coupled and decoupled from the generator 102 via one or more switching elements.

Each of the interrupt detection modules 160 ₁, . . . , 106 _(N) may comprise suitable logic, circuitry, and/or code that may be operable to identify an interrupt signal generated by an accessory or peripheral 110 attached to the accessory or peripheral port 104. Accordingly, various functions of each interrupt detection module 106 _(i), where ‘i’ is an integer between 1 and ‘N’, may be implemented via hardware, firmware, and/or software. In an exemplary embodiment of the invention, each of the interrupt detection modules 106 ₁, . . . , 106 _(N) may be implemented via analog HW 206, digital HW 208, and a processor 210 as described below with respect to FIG. 2.

In operation, attachment of an accessory or peripheral 110 may be detected via a voltage level on the conductor 111. Subsequently, the interrupt detection modules 106 ₁, . . . , 106 _(N) may enable, via the signals 109 ₁, . . . , 109 _(N), the bias generator 102 to apply a bias to the conductors 105 ₁, . . . , 105 _(N). The applied bias may result in a DC voltage developing on one the conductors 105 ₁, . . . , 105 _(N). Additionally, the conductors 105 ₁, . . . , 105 _(N) may also convey data which may be generated and/or processed by modules and/or circuitry such as the analog HW 206, the digital HW 208, and the processor 210 described below with respect to FIG. 2. “Data,” as utilized herein, may refer to any analog and/or digital information including but not limited to voice, Internet data, and/or multimedia content. Multimedia content may comprise audio and/or visual content comprising, video, still images, animated images, and/or textual content. The attached accessory or peripheral 110 may generate an interrupt signal to indicate that a data exchange over the conductors 105 ₁, . . . , 105 _(N) may be desired or necessary. For example, the user may want to accept or terminate a call. In various exemplary embodiments of the invention, the attached accessory or peripheral may generate an interrupt signal by grounding one or more of the conductors 105 ₁, . . . , 105 _(N). Accordingly, one or more of the interrupt detection modules 106 ₁, . . . , 106 _(N) may detect the corresponding one or more of the conductors being grounded and determine that an interrupt may have been received from the attached accessory or peripheral.

The conductors 105 ₁, . . . , 105 _(N) may be capacitively coupled to signal processing circuitry to remove the DC bias applied by the bias generator 102. This may reduce the number of pins required in the accessory or peripheral port and/or enable accessory or peripheral type identification, in accordance with various embodiments of the invention, to be compatible with existing accessory or peripheral ports.

FIG. 2 is a diagram illustrating an exemplary electronic device enabled to interface with a variety of accessories or peripherals via an accessory or peripheral port, in accordance with an embodiment of the invention. Referring to FIG. 2, the device 202 may comprise an accessory or peripheral port 204, analog hardware (HW) 206, digital hardware (HW) 208, a processor 210, a switch 212, and a bus 205. In an exemplary embodiment of the invention, the analog HW 206 and the digital HW 208 may be implemented in the hardware audio CODEC 164.

The accessory or peripheral port 204 may be similar to or the same as the accessory or peripheral port 104 described with respect to FIG. 1B. The switch 212 may be similar to or the same as the switch 112 described with respect to FIG. 1B. That is, switch 212 may be a mechanical switch which may couple the conductor 211 to GND, as indicated by the dashed line, while an accessory or peripheral may be attached to the accessory or peripheral port 204.

The bus 205 may comprise one or more conductors similar to or the same as the conductors 105 ₁, . . . , 105 _(N) described with respect to FIG. 1B. In this regard, the bus 205 may convey power and/or data between the analog HW 206 and the accessory or peripheral port 204. Accordingly, an attached accessory or peripheral may send interrupt signals to the device 202 via the bus 205.

The analog HW 206 may comprise logic and/or circuitry that may be operable to bias one or more conductors of the bus 205 coupled to the port 204 and monitor voltage levels on the bus 205. Additionally, the analog HW 206 may be operable to down-convert, demodulate, convert to digital, amplify, and/or otherwise process signals received via the accessory or peripheral port 204. In various embodiments of the invention, the analog HW 206 may be configured via one or more control signals from the digital HW 208 and/or the processor 210.

The digital HW 208 may comprise suitable logic and/or circuitry that may be operable to filter and/or otherwise condition digital signals for conveyance to the processor 210. In this regard, the digital HW 208 may be enabled to filter outputs from the analog HW 206 to reduce or prevent false detections of interrupt signals. In various embodiments of the invention, the digital HW 208 may be configured via one or more control signals from the processor 210.

The processor 210 may comprise suitable logic, circuitry, and/or code that may be operable to configure and/or control one or more portions of the device 202, control data transfers between portions of the device 202, and/or otherwise process data. The processor 210 may be operable to process data from an attached accessory or peripheral, control an attached accessory or peripheral, and/or otherwise exchange data with an attached accessory or peripheral. In this regard, an attached accessory or peripheral may be operable to generate an interrupt signal when it may need attention from the processor 210. Accordingly, upon notification, from the digital HW 208, of a received interrupt, the processor 210 may perform one or more functions to support operation of the attached accessory or peripheral. The processor 210 may be any suitable processor or controller. For example, the processor 210 may be a reduced instruction set computing (RISC) microprocessor such as an advanced RISC machine (ARM), advanced virtual RISC (AVR), microprocessor without interlocked pipeline stages (MIPS), or programmable intelligent controller (PIC).

In operation, the analog HW 206 may compare a voltage on one or more conductors of the bus 205 to one or more reference voltages. Results of the comparison(s) may be conveyed to the digital HW 208. The digital HW 208 may filter the result(s) of the comparison(s) and may convey the filtered result(s) to the processor 210. In an exemplary embodiment of the invention, a bias applied to one or more conductors of the bus 205 may result in a voltage on the one or more conductors greater than the reference voltage. Accordingly, an attached accessory or peripheral may generate an interrupt signal by grounding the one or more conductors to bring the voltage on the one or more conductors below the reference voltage. The result of the comparison may be filtered by the digital HW 208 in order to reduce or prevent false interrupt detections. In this regard, the processor 210 may be notified of a detected interrupt signals after the voltage on the one or more conductors of the bus 205 has been below the reference voltage for, for example, a required number of consecutive clock cycles or a certain percentage of clock cycles. In this regard, the required number of clock cycles and/or percentage of clock cycles may be determined dynamically or configured by a system designer. In various embodiments of the invention, two or more of the analog HW 206, the digital HW 208, and the processor 210 may be implemented on a common substrate and may be part of a “system on chip”.

FIG. 3 is a diagram illustrating an exemplary subsystem for detection of interrupts from an attached accessory or peripheral, in accordance with an embodiment of the invention. Referring to FIG. 3, there is shown an exemplary interrupt detection module 106 _(i) comprising exemplary analog HW 306, exemplary digital HW 314, and an exemplary processor 316. The analog HW 306 may comprise a comparator 304. The digital HW 314 may comprise an inverter 308, a filter 310, and a filter 312. In an exemplary embodiment of the invention, the analog HW 306 and the digital HW 314 may be implemented in the hardware audio CODEC 164 described with respect to FIG. 1A.

The comparator 304 may comprise suitable logic and/or circuitry that may be operable to assert the signal 305 when the voltage on conductor 105 _(i) is greater than VREF and de-assert the signal 305 when the voltage on conductor 105 _(i) is less than VREF. In various embodiments of the invention, VREF may be determined by the processor 316 utilizing, for example, a look-up table. The value of VREF may be configured in real-time. Exemplary factors in determining VREF may comprise the bias voltage applied to the one or more conductors of the bus 205 and/or a type, class, model, and/or state of an attached accessory or peripheral.

The inverter 308 may be operable to invert the digital logic value of the signal 305. In this regard, COMP0 may be de-asserted while the voltage on conductor 105 _(i) may be greater than VREF and may be asserted when the voltage on conductor 105 _(i) may be less than VREF.

The filters 310 and 312 may each comprise suitable logic and/or circuitry that may be operable to de-bounce or otherwise remove noise from the signal COMP0. In an exemplary embodiment of the invention, the filters 310 and 312 may de-bounce COMP0 to generate COMP1 and COMP2, respectively. In an exemplary embodiment of the invention, the filters 310 and 312 may de-bounce the signal differently and thus COMP1 and COMP2 may exhibit different responses to the same accessory or peripheral type.

In operation, the conductor 105 _(i) may be biased such that the voltage on conductor 105 _(i) may normally be greater than VREF. Accordingly, output 305 of the comparator 304 may be asserted during normal operation, when no interrupt signal may be present from an accessory or peripheral. However, when an attached accessory or peripheral may require attention from the processor 316, the accessory or peripheral may ground the conductor 105 _(i) and may cause the output 305 of the comparator 304 to be de-asserted. The inverter 308 may invert the signal 305 and thus COMP0 may be asserted while an interrupt may be present. However, in order to prevent false detection of interrupts, glitches and/or other issues which may result from noise or bounce on the conductor 105 _(i), COMP0 may be filtered prior to being conveyed to the processor 316. In this regard, COMP0 may be filtered and/or de-bounced by filters 310 and 312 to generate COMP1 and COMP2, respectively. The processor 316 may determine an interrupt signal has been received when one or more of COMP0, COMP1, and COMP2 are asserted. In some embodiments of the invention, which of COMP0, COMP1, and COMP2 are utilized and/or an order in which COMP0, COMP1, and COMP2 are monitored may be based on the type of accessory or peripheral.

FIG. 4 is a diagram illustrating an exemplary filter for de-bouncing interrupt signals, in accordance with an embodiment of the invention. Referring to FIG. 4, the exemplary filter 310 may comprise a plurality of registers 402 ₁, . . . , 402 _(T-1), an adder 404, and a comparison module 406.

Each of the registers 402 may comprise one or more memory elements such as a flip-flop. A value at the input of each register 402 _(k), where ‘k’ is an integer between 1 and T−1, may be stored and conveyed to an output of the register 402 _(k) on each active edge of CLK.

The adder 404 may comprise suitable logic and/or circuitry that may be operable to add the outputs of the registers 402 ₁, . . . , 402 _(T-1). Accordingly, SUM1 generated by the adder 404 may be a value between 0 and ‘T’.

The comparison module 406 may comprise suitable logic and/or circuitry that may be operable to compare SUM1 to a value ‘T’. In this regard, ‘T’ may be the number of registers 402 and thus a logic ‘1’ stored in each of the registers 402 ₁, . . . , 402 _(T-1) may result in SUM1 being equal to ‘T’. In instances that SUM1 may be equal to ‘T’, then COMP1 may be asserted. In this manner, COMP1 may be asserted after COMP0 has been logic ‘1’ for ‘T’ consecutive cycles of CLK.

In operation, COMP0 may be sampled and stored in register 402 ₁ on each active edge of CLK. Similarly, the output of each register 402 _(t-1) may be stored in register 402 _(t) on each active edge of CLK, where ‘t’ is an integer between 1 and ‘T−1’. Thus, in instances that COMP0 has been logic ‘1’ for ‘T’ consecutive cycles of CLK, a logic ‘1’ may be stored in all of the registers 402 ₁, . . . , 402 _(T-1). However, when transitioning from logic ‘0’ to logic ‘1’, COMP0 may oscillate, or “bounce”, between logic ‘0’ and logic ‘1’ several times before stabilizing. In this regard, ‘T’ consecutive samples of logic ‘1’ may be unlikely while COMP0 is bouncing. Thus COMP1 may remain de-asserted until COMP0 stabilizes at logic 1. Similarly, in instances that noise or spurious signals may be present on COMP0, it may be unlikely that the noise will cause an erroneous logic ‘1’ for ‘T’ consecutive samples. In this manner, false assertions of COMP1 may be prevented or at least reduced via the filter 310.

FIG. 5 is a diagram illustrating an exemplary filter for de-bouncing interrupt signals, in accordance with an embodiment of the invention. Referring to FIG. 5 the exemplary filter 312 may comprise an adder 502, a register 504, switch 506, comparison module 510, switch 512, registers 514 ₁, . . . , 514 _(S-1), adder 516, and comparison module 518.

The registers 504 may comprise one or more memory elements. A value at the input of the register 504 may be stored and conveyed to an output of the register on each active edge of CLK.

The adder 502 may comprise suitable logic and/or circuitry that may be operable to sum COMP0 with the output 505 of the register 504. COMP0 may be a 1-bit signal and the output of the register 504 may be multiple bits.

The switch 506 may be operable to couple the input of the register 504 to either GND or the signal 503. The switch 506 may be configured based on a mode of operation of the filter 312. In this regard, position indicated by the dashed line may correspond to a decimate-by-M mode of operation. Conversely, the position indicated by the solid line may correspond to an integrate-and-dump mode of operation. The switch 506 may be configured via one or more control signals from, for example, the processor 316.

The switch 508 may be operable to couple the signal 503 to the comparison module 510 on every M^(th) cycle of CLK.

The comparison module 510 may comprise suitable logic and/or circuitry that may be operable to compare signal 503 output by the adder 502 to a value ‘X’. For the integrate-and-dump mode of operation, in instances that the signal 503 may be greater than ‘X’, then the signal 510 may be asserted. In this manner, the signal 510 may be asserted when COMP0 has been logic ‘1’ for ‘X’ out of ‘M’ cycles of CLK, where ‘M’ may be an integer greater than or equal to 1.

The switch 512 may be operable to couple the input of the register 514 ₁ to either the signal 509 or the signal 511. The switch 512 may be configured based on a mode of operation of the filter 310. In this regard, position indicated by the dashed line may correspond to a decimate-by-M mode of operation. Conversely, the position indicated by the solid line may correspond to an integrate-and-dump mode of operation. The switch 512 may be configured via one or more control signals from, for example, the processor 316.

Each of the registers 514 ₁, . . . , 514 _(S-1) may comprise one or more memory elements such as a flip-flop. A value at the input of each register 514 _(k), where ‘k’ is an integer between 1 and T−1, may be stored and conveyed to an output of the register 514 _(k) every M^(th) active edge of CLK (i.e., CLK/M).

The adder 516 may be similar to or the same as the adder 404 described with respect to FIG. 4. In this regard, the adder 516 may be operable to add the outputs of the registers 514 ₁, . . . , 514 _(S-1) to generate SUM2.

The comparison module 518 may comprise suitable logic and/or circuitry that may be operable to compare SUM2 to a value ‘S’. In this regard, ‘S’ may be the number of registers 514 and thus a logic ‘1’ stored in each of the registers 514 may result in the SUM2 being equal to ‘S’. In instances that the SUM2 may be equal to ‘S’, then COMP2 may be asserted. In this manner, COMP2 may be asserted after the signal 513 has been logic ‘1’ for ‘S’ consecutive cycles of CLK/M.

In the decimate-by-M mode of operation, every M^(th) sample of COMP0 may be stored in the register 514 ₁. Furthermore, every M^(th) cycle of CLK, the output of register 514 _(s-1) may be stored and output by register 514 _(s), where ‘s’ may be an integer between 1 and ‘S’. Thus, in instances that ‘S’ consecutive samples of signal 513 are logic ‘1’, a logic ‘1’ may be stored in all of the registers 514 ₁, . . . , 514 _(S-1) and SUM2 may be equal to ‘S’. In instances that SUM2 may be equal to ‘S’, COMP2 may be asserted.

In the integrate-and-dump mode of operation, COMP0 may be added to the value stored in the register 504 on each active edge of CLK. Every M^(th) cycle of CLK, the accumulated value stored in the register 504 may be input to the comparison module 510. The comparison module 510 may compare the accumulated value from the register 504 with ‘X’. In instances that the accumulated value in the register 504 may be greater than ‘X’, the signal 511 may be asserted. The signal 511 may be stored into the register 514 ₁ every M^(th) cycle of CLK. Furthermore, every M^(th) cycle of CLK, the output of register 514 _(s-1) may be stored and output by register 514 _(s), where ‘s’ may be an integer between 1 and ‘S’. Thus, in instances that ‘S’ consecutive samples of the signal 513 are logic ‘1’, all of the registers 514 ₁, . . . , 514 _(TS1) may output a logic ‘1’ and SUM2 may be equal to ‘S’. In instances that SUM2 may be equal to ‘S’, COMP2 may be asserted.

FIG. 6 is a flow chart illustrating exemplary steps for detecting and handling interrupts from an attached accessory or peripheral, in accordance with an embodiment of the invention. Referring to FIG. 6, the exemplary steps may begin with step 602 when it may be detected that an accessory or peripheral may be attached to an electronic device, such as the device 150 (FIG. 1A). For example, a mechanical switch, such as the switch 112, may be utilized to detect attachment of an accessory or peripheral. Subsequent to step 602, the exemplary steps may advance to step 604.

In step 604, a bias may be applied, via one or more generators such as the generator 102 (FIG. 1B), to one or more conductors electrically coupled to the attached accessory or peripheral, such as the conductors 105 ₁, . . . , 105 _(N). The bias may result in voltages V₁₀₅₁, . . . , V_(105N), respectively, on the conductors 105 ₁, . . . , 105 _(N). Subsequent to step 604, the exemplary steps may advance to step 606.

In step 606, the attached accessory or peripheral may be identified. U.S. patent application Ser. No. 12/268,304 describes a method and system for identifying the attached accessory or peripheral and is hereby incorporated herein by reference in its entirety. Subsequent to step 606, the exemplary steps may advance to step 608.

In step 608, the processor 316 may monitor the state and/or behavior of one or more of COMP0, COMP1, and COMP2 to detect interrupts generated by the attached accessory or peripheral. In this regard, which of the comparator and/or filter outputs are monitored may be determined based on, for example, the attached accessory or peripheral and/or the bias voltage applied to one or more pins of the accessory or peripheral port. Additionally, how the state and/or behavior of COMP0, COMP1, and/or COMP2 may be interpreted may be determined based on the attached accessory or peripheral and/or the bias voltage applied to one or more pins of the accessory or peripheral port. Characteristics of the accessory or peripheral such as type, class, manufacturer identifier, and/or model identifier of the attached accessory or peripheral may factor into detection of interrupts. Exemplary types of accessories or peripherals may comprise microphones, earpieces, storage devices, and input devices. Exemplary classes of accessories or peripherals may comprise powered or non-powered and high-speed or low-speed. Subsequent to detection of an interrupt signal, the exemplary steps may advance to step 610.

In step 610, the processor 316 may allocate one or more time-slots for interfacing with the accessory or peripheral, exchanging information with the accessory or peripheral, and/or otherwise supporting operation of the accessory or peripheral. In this regard, the processor 316 may be operable to execute a service routing, application and/or other code that may be utilized to service the interrupt.

Exemplary aspects of a method and system for detecting interrupts from detachable electronic accessories or peripherals are provided. In an exemplary embodiment of the invention, a hardware audio CODEC 164 (FIG. 1A) may be operable to compare a voltage on one or more biased pins of an accessory or peripheral port 166 (FIG. 1A) to one or more reference voltages. The hardware audio CODEC 164 may also filter one or more output signals generated from the comparison. When an accessory or peripheral such as the accessory or peripheral 110 (FIG. 1A) may be coupled to the accessory or peripheral port 104 (FIG. 1B), interrupts from the accessory or peripheral 110 (FIG. 1B) may be detected by, for example, the processor 316 based on results of the comparison and/or the filtering. The hardware audio CODEC 164 may bias the one or more pins by applying a voltage, via the bias generator 102 (FIG. 1B), to each of the one or more pins via one or more resistances. The one or more output signals 305 (FIG. 3) generated from the comparison may be filtered based on a class, type, manufacturer identifier, and/or model identifier of an accessory or peripheral attached to the accessory or peripheral port. A state and/or behavior of the one or more output signals 305 (FIG. 3) generated from the comparison may be interpreted based on a class, a type, a manufacturer identifier, and/or a model identifier of an accessory or peripheral 110 (FIG. 1B) attached to the accessory or peripheral port 104 (FIG. 1B). A state and or behavior of the filtered one or more signals, COMP0, COMP1, and/or COMP2 (FIG. 3), may be interpreted based on a class, a type, a manufacturer identifier, and/or a model identifier of an accessory or peripheral 110 (FIG. 1B) attached to the accessory or peripheral port 104 (FIG. 1B). The one or more signals 305 (FIG. 3) generated from the comparison may be filtered by one or more filters such as the filters 310 and 312 (FIG. 3) which may be configured into integrate-and-dump or decimate-by-M modes of operation. An interrupt may be detected when the voltage V_(105i) (FIG. 3) on the one or more pins may be below the one or more reference voltages VREF (FIG. 3). An interrupt may be detected when the voltage on the one or more pins may be below the one or more reference voltages for a plurality of consecutive clock cycles.

Another embodiment of the invention may provide a machine and/or computer readable storage and/or medium, having stored thereon, a machine code and/or a computer program having at least one code section executable by a machine and/or a computer, thereby causing the machine and/or computer to perform the steps as described herein for detecting interrupts from detachable electronic accessories or peripherals.

Accordingly, the present invention may be realized in hardware, software, or a combination of hardware and software. The present invention may be realized in a centralized fashion in at least one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system or other apparatus adapted for carrying out the methods described herein is suited. A typical combination of hardware and software may be a general-purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.

The present invention may also be embedded in a computer program product, which comprises all the features enabling the implementation of the methods described herein, and which when loaded in a computer system is able to carry out these methods. Computer program in the present context means any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: a) conversion to another language, code or notation; b) reproduction in a different material form.

While the present invention has been described with reference to certain embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the scope of the present invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the present invention without departing from its scope. Therefore, it is intended that the present invention not be limited to the particular embodiment disclosed, but that the present invention will include all embodiments falling within the scope of the appended claims. 

What is claimed is:
 1. A method for processing signals, the method comprising: comparing, in a hardware audio CODEC, a voltage on one or more biased pins of an accessory or peripheral port to one or more reference voltages; filtering, in said hardware audio CODEC, one or more output signals generated from said comparison based on a characteristic of an accessory or peripheral attached to said accessory or peripheral port; and when said accessory or peripheral is coupled to said accessory or peripheral port, detecting an interrupt from said accessory or peripheral based on results of said comparison or said filtering.
 2. The method according to claim 1, comprising biasing, via said hardware audio CODEC, said one or more pins of said accessory or peripheral port via said hardware audio CODEC.
 3. The method according to claim 2, comprising applying, via said hardware audio CODEC, said voltage to each of said one or more pins via one or more resistances.
 4. The method according to claim 1, wherein said characteristic comprises a class, type, manufacturer identifier, or model identifier of said accessory or peripheral attached to said accessory or peripheral port.
 5. The method according to claim 1, comprising interpreting a state or behavior of said one or more output signals generated from said comparison based on said characteristic of said accessory or peripheral attached to said accessory or peripheral port.
 6. The method according to claim 1, comprising interpreting a state or behavior of said filtered one or more signals based on said characteristic of said accessory or peripheral attached to said accessory or peripheral port.
 7. The method according to claim 1, comprising filtering, in said hardware audio CODEC, said one or more output signals generated from said comparison via one or more filters configured into an integrate-and-dump mode of operation.
 8. The method according to claim 1, comprising filtering, in said hardware audio CODEC, said one or more output signals generated from said comparison via one or more filters configured into a decimate-by-M mode of operation.
 9. The method according to claim 1, comprising detecting said interrupt when said voltage on said one or more biased pins is below said one or more reference voltages.
 10. The method according to claim 1, comprising detecting said interrupt when said voltage on said one or more biased pins is below said one or more reference voltages for a plurality of consecutive clock cycles.
 11. A system for processing signals, the system comprising: one or more circuits for use in a hardware audio CODEC configured to compare a voltage on one or more biased pins of an accessory or peripheral port to one or more reference voltages and to filter one or more output signals that are generated from said comparison based on a characteristic of said accessory or peripheral attached to said accessory or peripheral port, wherein an interrupt from said accessory or peripheral is detected based on results of said comparison or said filtering when said accessory or peripheral is coupled to said accessory or peripheral port.
 12. The system according to claim 11, wherein said one or more circuits are configured to bias said one or more pins of said accessory or peripheral port.
 13. The system according to claim 12, wherein said one or more circuits are configured to apply said voltage to each of said one or more pins via one or more resistances.
 14. The system according to claim 11, wherein said characteristic comprises a class, type, manufacturer identifier, or model identifier of said accessory or peripheral attached to said accessory or peripheral port.
 15. The system according to claim 11, wherein a state or behavior of said one or more output signals generated from said comparison is interpreted based on said characteristic of said accessory or peripheral attached to said accessory or peripheral port.
 16. The system according to claim 11, wherein a state or behavior of said filtered one or more signals is interpreted based on said characteristic of said accessory or peripheral attached to said accessory or peripheral port.
 17. The system according to claim 11, wherein said one or more circuits comprise a filter configured into an integrate-and-dump mode of operation.
 18. The system according to claim 11, wherein said one or more circuits comprise a filter configured into a decimate-by-M mode of operation.
 19. The system according to claim 11, wherein said interrupt is detected when said voltage on said one or more biased pins is below said one or more reference voltages.
 20. The system according to claim 11, wherein said interrupt is detected when said voltage on said one or more biased pins is below said one or more reference voltages for a plurality of consecutive clock cycles. 